{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import random\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from os import listdir\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "from scipy import stats\n",
    "import scipy.cluster.hierarchy as sch\n",
    "\n",
    "import tensorflow as tf\n",
    "from tensorflow.keras.models import *\n",
    "from tensorflow.keras.layers import *\n",
    "from tensorflow.keras.callbacks import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(20, 170, 3)"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "### READ DATA ###\n",
    "\n",
    "data, person_id = [], []\n",
    "for txt in listdir('Walk_MODEL'):\n",
    "    measure = pd.read_csv('Walk_MODEL/'+txt, sep=' ', header=None).values\n",
    "    data.append(measure)\n",
    "    person_id.append(txt.split('-')[-1].split('.')[0])\n",
    "\n",
    "data = np.asarray(data)\n",
    "data.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0.5, 0, 'Time')"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEWCAYAAAByqrw/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nOydeXhU1d34P3eyh+wJCVlJWAIk7IugoEURRHEHRK1LXWq1tmqtS7W1Wt+2r762LrW2Lv25o2JYFUFEEK0be1iSkASSQPadZLJnZu7vjzN3lmSSTJLJfj7PM8/M3Llz77nb93zPdzuKq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9tR5PiTFeAWlb9xaAN+R/NwH4JYB98vHHAXTWeqyqMS+FFCXwJoD9bG4BNAN4FsBR+Wew1mPVjNsDYByAX3VsQc0zpIfOWQBpSJriXeXmFcB98vo+DODGBTTmdyDZpdma/pH82dvkNfMmgNcA3LKAxlxyLSzUeZaP/wLA5zWfndM8i5ICAoFAsMioB1OMQCAQCCpACHaBQCBYZAjBLhAIBIsMIdgFAoFgkSEEu0AgECwybLUegEBgBoQQFloIAB0AsgDG5PdxSullNRmYQMABEe4oWPQQQr4JIEop/Ydaj0Ug4IEwxQguOAghUfnn1XJhpUcJIUcIId8hhNxJCNlNpBr1g/LnWgkhvyaE7JH/XV7bbyAQlEcIdsGFzjoA9wIYAvBJACsopcMAfgrgi/JnfgjgB5TSzZAyAX9ai4EKBEYRNnbBhc4eKpfSJYS8C+Ap+fg+ANfIr98PYJVUDggA4COENFKp7r5AsOAQgl1woZNUvc6p3ueQvz8sAC6llM7wHJhAMFeEKUYgmJ2nANzD3hBC1tdwLALBrAjBLhDMzpcAbJI78hwA8PlaD0ggKIcIdxQIBIJFhtDYBQKBYJEhBLtAIBAsMoRgFwgEgkWGEOwCgUCwyBCCXSAQCBYZQrALBALBIkMIdoFAIFhk/H8Hqz9mWA21LgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "### EXEMPLE OF DATA FOR A SINGLE INDIVIDUAL ###\n",
    "\n",
    "plt.plot(data[11])\n",
    "plt.legend(['X','Y','Z'])\n",
    "plt.title(person_id[11]); plt.xlabel('Time')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "### STANDARDIZE DATA ###\n",
    "\n",
    "for i,s in enumerate(data):\n",
    "    data[i] = (data[i] - s.mean(axis=0)) / s.std(axis=0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# DIMENSIONALITY REDUCTION"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def set_seed(seed):\n",
    "    \n",
    "    tf.random.set_seed(seed)\n",
    "    os.environ['PYTHONHASHSEED'] = str(seed)\n",
    "    np.random.seed(seed)\n",
    "    random.seed(seed)\n",
    "\n",
    "def get_autoencoder(data):\n",
    "    \n",
    "    set_seed(33)\n",
    "\n",
    "    input_layer = Input(shape=(data.shape[1], data.shape[2]))\n",
    "    \n",
    "    encoder = TimeDistributed(Dense(200, activation='tanh'))(input_layer)\n",
    "    encoder = TimeDistributed(Dense(50, activation='tanh'))(encoder)\n",
    "    latent = TimeDistributed(Dense(10, activation='tanh'))(encoder)\n",
    "    decoder = TimeDistributed(Dense(50, activation='tanh'))(latent)\n",
    "    decoder = TimeDistributed(Dense(200, activation='tanh'))(decoder)\n",
    "\n",
    "    out = TimeDistributed(Dense(data.shape[2]))(decoder)\n",
    "\n",
    "    autoencoder = Model(inputs=input_layer, outputs=out)\n",
    "    autoencoder.compile(optimizer='adam', loss='mse')\n",
    "    \n",
    "    return autoencoder"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Model: \"functional_1\"\n",
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "input_1 (InputLayer)         [(None, 170, 3)]          0         \n",
      "_________________________________________________________________\n",
      "time_distributed (TimeDistri (None, 170, 200)          800       \n",
      "_________________________________________________________________\n",
      "time_distributed_1 (TimeDist (None, 170, 50)           10050     \n",
      "_________________________________________________________________\n",
      "time_distributed_2 (TimeDist (None, 170, 10)           510       \n",
      "_________________________________________________________________\n",
      "time_distributed_3 (TimeDist (None, 170, 50)           550       \n",
      "_________________________________________________________________\n",
      "time_distributed_4 (TimeDist (None, 170, 200)          10200     \n",
      "_________________________________________________________________\n",
      "time_distributed_5 (TimeDist (None, 170, 3)            603       \n",
      "=================================================================\n",
      "Total params: 22,713\n",
      "Trainable params: 22,713\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "autoencoder = get_autoencoder(data)\n",
    "autoencoder.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1/200\n",
      "1/1 - 0s - loss: 0.4554 - val_loss: 0.3788\n",
      "Epoch 2/200\n",
      "1/1 - 0s - loss: 0.3788 - val_loss: 0.3088\n",
      "Epoch 3/200\n",
      "1/1 - 0s - loss: 0.3088 - val_loss: 0.2441\n",
      "Epoch 4/200\n",
      "1/1 - 0s - loss: 0.2441 - val_loss: 0.1857\n",
      "Epoch 5/200\n",
      "1/1 - 0s - loss: 0.1857 - val_loss: 0.1361\n",
      "Epoch 6/200\n",
      "1/1 - 0s - loss: 0.1361 - val_loss: 0.0978\n",
      "Epoch 7/200\n",
      "1/1 - 0s - loss: 0.0978 - val_loss: 0.0718\n",
      "Epoch 8/200\n",
      "1/1 - 0s - loss: 0.0718 - val_loss: 0.0574\n",
      "Epoch 9/200\n",
      "1/1 - 0s - loss: 0.0574 - val_loss: 0.0522\n",
      "Epoch 10/200\n",
      "Restoring model weights from the end of the best epoch.\n",
      "1/1 - 0s - loss: 0.0522 - val_loss: 0.0529\n",
      "Epoch 00010: early stopping\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<tensorflow.python.keras.callbacks.History at 0x1a9e6d2e208>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "es = EarlyStopping(monitor='val_loss', mode='auto', restore_best_weights=True, verbose=1, patience=0)\n",
    "\n",
    "autoencoder = get_autoencoder(data)\n",
    "autoencoder.fit(data[:10],data[:10], epochs=200, verbose=2, validation_data=(data[:10],data[:10]), callbacks=[es])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'mse')"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA7AAAAGDCAYAAAASzPzoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3dfbRkZ10n+u+PToutoC2THqEbQhjFRl7UaAsiOhfHwSCDEBmdAR1UVHLxgleW2iNRl6SdhTBmdK7IjEwEdFBeBoeYCYIT8eL7HZS8YQihJfIi6WYggp0AaaUTnvtHVcPpouqcfc6pfap29eezVq8+tWvXrl/V3vup/a29n6eqtRYAAABYdvdYdAEAAADQhQALAADAIAiwAAAADIIACwAAwCAIsAAAAAyCAAsAAMAgCLAAsOSq6ryq+nhV7Vp0LX2okV+rqr+rqr9YdD0ALC8BFgA2qar+sKp+sMflv6+q/vnp2621v2mt3au1dndfz7lg35DkcUnu31p7ZFU9tKquGQfav6uq36+qhy66SAAWT4AFYKlV1TmLrmGzhlhzF9POAG/2rPCM9+aBSd7XWvvE+PbxJN+R5D5Jzk1yVZLXbq5aAFaRAAvA0hmfgfyJqvrLJJ+oqnOqan9Vvb6qbquq91bV/71m/l1V9ZNV9ddV9bGquraqHjC+7+ur6m1Vdfv4/69f87g/rKp/V1V/Nn7c71XVueP7PreqfrOqPlJVJ8aP/eKqekGSb0zykvFlvS8Zz9+q6tlV9e4k766q88fTzpl4vh9cc/uZVXXz+LnfWVVfXVW/keS8JG8YL//fTi5r/F5cVVUfrapbquqZa5Z5aVW9rqpeOV7uTVV1aJ33+iFV9ebxso5W1b9ac9+vV9WvVNWbquoTSb5pxrQvHD/fbVX1/qr66aq6x3gZ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p5V9aAkD07yFwuoj22oqscn+YkkT2qt3blm+r7xAG2pqn+S0fp9z2KqZKvWaZPtv6vjnyd5V2vt1tMTtrv/njP3Es9S49HxnpPk6iS7kryitXbTgstiex6T5OlJbjw97HeSn0zytKr6qowuZXlfkv9zMeWxTV+c5LdH31PknCSvbq39z6p6W5LXVdUPJPmbJN+5wBrZhqr6vIxGhl+7j/68/Xe4quo1SR6b5NyqujXJ85O8KFP22dbaTVX1uiTvzOjS02cbwXS5zVi/lyS5Z5I3j9vrt7bWnpXknyb52aq6K8ndSZ7VWus6QBALMGP9PnZam2z/HZ5p67e19vJ89jgUyTb3Xz+jAwAAwCC4hBgAAIBBEGABAAAYBAEWAACAQRBgAQAAGAQBFgAAgEEQYAFgAapqb1X9X+O/91fVf190TQCw7PyMDgAsQFWdn+R3WmsPX3ApADAY5yy6AAA4S70oyZdU1Q1J3p3ky1trD6+q70tyUZJdSR6e5BeSfE6Spyf5hyRPaK19tKq+JMl/SrIvyZ1Jntlae9fOvwwA2DkuIQaAxXhekr9urX1VksMT9z08yXcleWSSFyS5s7V2QZL/leR7xvNcnuSHW2tfk+THk/znHakaABbIGVgAWD5/0Fr7WJKPVdXtSd4wnn5jkq+oqnsl+fokv1VVpx9zz50vEwB2lgALAMvnH9b8/ak1tz+V0Wf3PZKcGJ+9BYCzhkuIAWAxPpbk3lt5YGvtjiTvrarvTJIa+cp5FgcAy0iABYAFaK19JMmfVdU7kly2hUV8d5IfqKq3J7kpyZPnWR8ALCM/owMAAMAgOAMLAADAIAiwAAAADIIACwAAwCAIsAAAAAyCAAsAAMAgCLAAAAAMggALAADAIAiwAAAADML/D3X9aOlGGo+mAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1152x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "### TRY TO RECONSTRUCT ERRORS ###\n",
    "\n",
    "predictions = autoencoder.predict(data[[11]])\n",
    "mse = np.mean(np.power(data[[11]] - predictions, 2), axis=2)\n",
    "\n",
    "plt.figure(figsize=(16,6))\n",
    "plt.scatter(range(data.shape[1]), mse)\n",
    "plt.title('reconstruction error '+person_id[11])\n",
    "plt.xlabel('time'); plt.ylabel('mse')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Pearson Correlation CLUSTERING"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAFmCAYAAAB0lsG5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAVFUlEQVR4nO3df6zd9X3f8efLBsexkyYtrrsGk13AaryJmRRdyKJZyxCO4h+riAsNKhEIhWIxJlimMiHxR/YHfyD/U4GmRZblRGiVF8TEjzJKRltrGis0rdwIYTMsrMWuuiaawbkSq+PZvve+98c9Xm6Nr699zzn+3o/P8yEd6XvO98f7Ddf3dT73e77n801VIUlqz5KuG5AkLYwBLkmNMsAlqVEGuCQ1ygCXpEYZ4JLUqCu6buBsq35paY1dc2WnPRx67xc7rV9L0ml9gHh1KUxPd90BLHGMxSK41Hl62dJO6//fExOcPnX8I8Gw6AJ87Jor+YvXrum0hy0bv9Zp/ekVyzqtD5DJRRBeHcvfnui6BWrFx7puATr+p5BFEOAn1nyy0/o/fPPfnfN1394lqVEGuCQ1ygCXpEYZ4JLUKANckhplgEtSowxwSWqUAS5JjTLAJalRBrgkNcoAl6RGDTzAkzyS5N0kE0neTvJWkn1JNgy6liSNsmFMZvUQsBl4HzheVZVkPfAcsG4I9SRpJA10BJ5kJ3Ad8DLwQP38lvcrge6nFJOky8hAR+BV9WCSTcCtVfVBkm3Ak8BqYOtc+yXZDmwH+OzVi26GW0lalIb6IWZVv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uR7+vzPz4ed07+XHq+rVi60v6ecMcElqVNPXgUvSKLuczoGPvCRXAXvPseq2IXzivujqS6PGUyiS1ChPoUhSowxwSWqUAS5JjTLAJalRBrgkNer/ARnCi3lhq3jlAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# ### COMPUTE CORRELATION MATRIX ###\n",
    "\n",
    "df = np.mean(np.power(data[10:] - autoencoder.predict(data[10:]), 2), axis=2)\n",
    "corr = np.corrcoef(df)\n",
    "\n",
    "plt.figure(figsize=(6,6))\n",
    "plt.imshow(corr)\n",
    "plt.xticks(range(len(person_id[10:])), person_id[10:])\n",
    "plt.yticks(range(len(person_id[10:])), person_id[10:])\n",
    "np.set_printoptions(False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAFmCAYAAAB0lsG5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAVO0lEQVR4nO3df6zd9X3f8efL1zgEUkiCi0gIyQUs1ZmIIcgQorljFp5iw6TEAhWNCERLcQkrLFVZkVCV/cEkxP5oQdoyzzIZWouKkPhRhNKhza1Gy49mlwphM1NYZK+ZNgVMnBIZx+be+94f93i9Nff62vec4+/9+Dwf0pG+53y/5/t+6/j4dT73e77n801VIUlqz7KuG5AkLY4BLkmNMsAlqVEGuCQ1ygCXpEYZ4JLUqOVdN3C0lZ8eq/ELTuu0h7ff+lSn9adXjHVaH2DZocmuW6DGuh1fxDNsZ3R9qnHSbf0l4ODhn3J48oOPvBBLLsDHLziNHzx/Qac9XLvhVzqtf/CCszqtD/DxH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vA3/Zd0MzRu69uBTqn1IBfkRVvZDk4iQrq6qTORBOUg+HZi1Pz7o/Te/ftncsfjuwqare66CHtcDjvTfsSuDaJJNV9cwgii+FD20aew2SfIKZP+O/XVXvD6IHfC92Uv+UCfAkq4Af9j7xLgdWAMN4kyzpHo7q5/PAU8DNVfVWFz1U1YWz+nkUeG6A/2Fm1+n8Q3s+S+k1SHIaM+H9WFU9Nege5jNK78WTWf+UCXDgeuCWJB8CB4Ebq3dwasR6mO07wDnAd3uf+pPV8cRCg7TUPjC7cCKvQWbeBI8wc5z8905im3CKvxe74i8x1Zwke5n5c/Q24BbgyAfmv6xjn0b4R8A/ZubP1x8D/6qqHhl2v8OwmNcgM79L+HNmvvyc7j18X1V9f+gNaygMcElqVNPngUvSKDuVjoFLJDkH2DHHqmuGdObDkuNrMDo8hCJJjfIQiiQ1ygCXpEYZ4JLUKANckhplgEtSo/4fF/aST2mIt6AAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "### HIERACHICAL CLUSTERING ###\n",
    "\n",
    "d = sch.distance.pdist(corr)\n",
    "L = sch.linkage(d, method='ward')\n",
    "ind = sch.fcluster(L, d.max(), 'distance')\n",
    "dendrogram = sch.dendrogram(L, no_plot=True)\n",
    "\n",
    "df = [df[i] for i in dendrogram['leaves']]\n",
    "labels = [person_id[10:][i] for i in dendrogram['leaves']]\n",
    "corr = np.corrcoef(df)\n",
    "\n",
    "plt.figure(figsize=(6,6))\n",
    "plt.imshow(corr)\n",
    "plt.xticks(range(len(person_id[10:])), labels)\n",
    "plt.yticks(range(len(person_id[10:])), labels)\n",
    "np.set_printoptions(False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.lines.Line2D at 0x1a9e802a160>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeoAAAFoCAYAAACYFbjpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAWnElEQVR4nO3df4wc533f8fcnpBQ3lhLH5llO9MMSGlmo4ppnm2USKI1OLWxQhg3VRf4QacSREOHq1GqRFnChFKiVNihSwH8kjSWFudgsmwYnAW0sm0UoS0kNVoZdNaKsiyUZoUMwKsTQFmkrkUJHqUrn2z92z16f93hDcu/22b33C1jczvM8M/vd4S4/M7Ozs6kqJElSm75n3AVIkqTVGdSSJDXMoJYkqWEGtSRJDTOoJUlqmEEtSVLDto67gGG2bdtWV1999bjLkCRpQzzxxBNfq6qZYX1NBvXVV1/N4cOHx12GJEkbIsn/Wa3PQ9+SJDXMoJYkqWEGtSRJDTOoJUlqmEEtSVLDDGpJkhpmUEuS1DCDWpKkhhnUkiQ1zKCWJKlhBrUkSQ0zqCVJaliTP8oxrRYWYHFx3FVI02/PHpifH3cV0mi4R72BFhdhaWncVUjTbWnJDWJNF/eoN9jsLBw6NO4qpOk1NzfuCqTRco9akqSGGdSSJDXMoJYkqWFrfkadZB/wbuBkVb15SP+HgPcNLO/vADNV9UKSZ4G/BL4JnKmqHaMqXJKkzaDLHvV+YNdqnVX1kaqarapZ4BeB/1lVLwwMuanfb0hLknSO1gzqqnoUeGGtcX27gfsvqCJJkvQtI/uMOsn30dvz/t2B5gIeSfJEkrNefiDJfJLDSQ6fOnVqVGVJkjTRRnky2XuAz6047H1DVb0NuBn4YJKfWm3mqlqoqh1VtWNmZmaEZUmSNLlGGdS3suKwd1Wd6P89CTwI7Bzh40mSNPVGEtRJfgC4EfjUQNurk1y6fB94J/D0KB5PkqTNosvXs+4H5oBtSY4DdwMXAVTV3v6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sqn5lves7H7731t2G1rwpgrp/2vyBqjqZ5Hp6Z+k9POayzmoSax7U3+N4GPhcVd017no6uA141cD0J4D/Bnx8LNV8p4nbSDuL22hzPXdax0m+F/gk8GfAP1nvos6H770NcRsbWPNmOfR9A/BUkm/Q+wGRg8C/Hm9Ja5rEmge9F/h7wO1JTg/crhp3YcNU1V9U1VeXb8ArwEsbfFgT6G2kJXl9//7yRtr/6DDfRUleRe99vTXJq/qfpTWjlfV8Pus4yUX0/jN+GXh/I5+nDuN7b51tdM3+KIfUgCSHgN+pqo8l+U/0fo3uEnpn+/9X4N9U1V+vsYz9wM+uaL69qvaPvOAJdKHrOMmN9M7ufZne1yWX3VxVn12vuiWDWpKkhm2WQ9+SJE2kTXEymTQNkvx94KFhfVW1IVfHmnauY7XIQ9+SJDXMQ9+SJDXMoJYkqWEGtSRJDTOoJUlqmEEtSVLD/j+bT8C5f4SGaQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 576x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "### PLOT DENDROGRAM ###\n",
    "\n",
    "plt.figure(figsize=(8,6))\n",
    "dendrogram = sch.dendrogram(L, labels=person_id[10:])\n",
    "plt.axhline(d.max(), c='black')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Kolmogorov-Smirnov CLUSTERING"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "def KScoeff(df):\n",
    "    \n",
    "    ks_matrix = np.zeros((len(df),len(df)))\n",
    "    for i in range(len(df)):\n",
    "        for j in range(i+1,len(df)):\n",
    "            ks_test = stats.ks_2samp(df[i], df[j])\n",
    "            ks_matrix[i,j] = ks_test.statistic\n",
    "            ks_matrix[j,i] = ks_test.statistic\n",
    "            \n",
    "    return ks_matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "out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FZAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "### COMPUTE KOLMOGOROV SMIRNOV MATRIX ###\n",
    "\n",
    "df = np.mean(np.power(data[10:] - autoencoder.predict(data[10:]), 2), axis=2)\n",
    "ks_matrix = KScoeff(df)\n",
    "\n",
    "plt.figure(figsize=(6,6))\n",
    "plt.imshow(ks_matrix)\n",
    "plt.xticks(range(len(person_id[10:])), person_id[10:])\n",
    "plt.yticks(range(len(person_id[10:])), person_id[10:])\n",
    "np.set_printoptions(False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAFmCAYAAAB0lsG5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAVWklEQVR4nO3db4xddX7f8fcH/4nB2cDGXrIbYBnAar0rajZoYEG1srWgCX9W2rVAQWWziA3BpVTQrULFhkjbBzwgPEkhUpFleTeoKlq0En+K0K5Qa0WhgSVoElnY1GhJ11RN1BYDDo6MF3s83z7wtTQxHv+Ze8+c+fm+X9JI595zz/l+5/jOZ34+98zvpKqQJLXnrL4bkCTNjwEuSY0ywCWpUQa4JDXKAJekRhngktSopX03cKzl+YVawcpeezi8qt/6lV7LH+lhEfxqX/pxv5e4Hl7e/z/EFz+3p+8W2HXg03230Lslmem1/s//7z4OfnjgE2/IRRfgK1jJl3Ndrz188LVre60/s6zX8gBMn9N/eJ3319O91t93cf8/Hq//wRN9t8A122/tu4XenbfiQK/1X/uXPzju84tgnCVJmg8DXJIaZYBLUqMMcElqlAEuSY0ywCWpUQa4JDXKAJekRhngktQoA1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SrK6qTuYEOd2gTPKLHDmt9e2q2tdFT8f0t+iOwSi0HOAnVFWXHF1O8iTw4oh/aE8oyeeBZ4FvVtVPF6rubH0fg8XQQ9/1B3UX/L2QZA3wPwf/E7gSWA50/ovjVIIyyTKOhPdTVfVsV70s5mMwKmdsgC8C3wVWAU8MRn/T1fOkPupNH++FW4A7khwCDgC31eDE66idTlDmyAH4HkfOEf9RF/3MsiiPwUjrdvT9SDrDJXmHI6eo7gLuAI4G5b+ruS8jXA/8d4588DczePqhqvpR5w13YD7HYLDdD4B/xpHTev8P+PdV9b3Trm+AS1KbmrwOXJLkOXBJHUiyCth2nFXXLfRVOH1ZiGPgKRRJapSnUCSpUQa4JDXKAJekRhngktQoA1ySGvX/AYM5j4yyyir3AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "### HIERACHICAL CLUSTERING ###\n",
    "\n",
    "d = sch.distance.pdist(ks_matrix)\n",
    "L = sch.linkage(d, method='ward')\n",
    "ind = sch.fcluster(L, d.max(), 'distance')\n",
    "dendrogram = sch.dendrogram(L, no_plot=True)\n",
    "\n",
    "df = [df[i] for i in dendrogram['leaves']]\n",
    "labels = [person_id[10:][i] for i in dendrogram['leaves']]\n",
    "ks_matrix = KScoeff(df)\n",
    "\n",
    "plt.figure(figsize=(6,6))\n",
    "plt.imshow(ks_matrix)\n",
    "plt.xticks(range(len(person_id[10:])), labels)\n",
    "plt.yticks(range(len(person_id[10:])), labels)\n",
    "np.set_printoptions(False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.lines.Line2D at 0x1a9e5068b70>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeMAAAFoCAYAA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1s4wlSWpmGUuS1MwyliSp2f8Hfn/4tQrAGsUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 576x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "### PLOT DENDROGRAM ###\n",
    "\n",
    "plt.figure(figsize=(8,6))\n",
    "dendrogram = sch.dendrogram(L, labels=person_id[10:])\n",
    "plt.axhline(d.max(), c='black')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
